#pragma once

#include <windows.h>
#include "internetdll.h"

class PMInternetFile
{
public:
	PMInternetFile(void);
	~PMInternetFile(void);
	DWORD Open(LPCTSTR);
	DWORD OpenEx(LPCTSTR,DWORD start=0,DWORD end=0);
	DWORD Close(void);
	DWORD Write(LPVOID,DWORD);
	DWORD Read(LPVOID buf,DWORD bufsize,DWORD *);
	DWORD FileSize();
protected:
	DWORD SetTimeOut(DWORD value);
	DWORD SetRange(DWORD start,DWORD end);
private:
	HINTERNET hInternet;
	HINTERNET hRequest;
	HINTERNET hConnect;
};
